package wangn.adt.lrparsing;

import java.util.HashMap;
import java.util.Map;

public class RootNode {
    private Map<Integer,InnerNode> childMap = new HashMap<>();
    public InnerNode getChild(int state){
        return childMap.getOrDefault(state,null);
    }
    public InnerNode addChild(int state){
        if (childMap.containsKey(state)){
            return childMap.get(state);
        }else{
            InnerNode innerNode = new InnerNode();
            childMap.put(state,innerNode);
            return innerNode;
        }
    }
}
